import { createBrowserRouter } from 'react-router-dom'
import HomeTab from '@/pages/HomeTab'
import Product from '@/pages/Product'
import ProductCate from '@/pages/ProductCate'
import ProductList from '@/pages/ProductList'
import ProductDetail from '@/pages/ProductDetail'
import Solution from '@/pages/Solution'
import SolutionList from '@/pages/Solution/List'
import SolutionDetail from '@/pages/Solution/List/Content'
import NewsList from '@/pages/News'
import NewsDetail from '@/pages/News/Content'
import Support from '@/pages/Support'
import ProbList from '@/pages/Support/Prob'
import ProbDetail from '@/pages/Support/Prob/Content'
import Layout from '@/pages/Layout'
import Detail from '@/pages/Detail'

const router = createBrowserRouter([
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        index: true,
        element: <HomeTab />
      },
      {
        path: '/product',
        element: <Product />
      },
      {
        path: '/product/:id',
        element: <ProductCate />
      },
      {
        path: '/product/list/:id',
        element: <ProductList />
      },
      {
        path: '/product/detail/:id',
        element: <ProductDetail />
      },
      {
        path: '/solution',
        element: <Solution />
      },
      {
        path: '/solution/list/:id',
        element: <SolutionList />
      },
      {
        path: '/solution/detail/:id',
        element: <SolutionDetail />
      },
      {
        path: '/news',
        element: <NewsList />
      },
      {
        path: '/news/detail/:id',
        element: <NewsDetail />
      },
      {
        path: '/support',
        element: <Support />
      },
      {
        path: '/problems',
        element: <ProbList />
      },
      {
        path: '/problems/detail/:id',
        element: <ProbDetail />
      },
    ]
  },
  {
    path: '/detail',
    element: <Detail />,
  },
])

export { router }
